{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/page/user.css">
<body>
<div class="main">
    <img src="/static/index/images/bg/bg_wodbigbj@2x.png" alt="" class="img-top"/>

    <div class="icons flex items-center justify-end mt-30">
        <img src="/static/index/images/user/ic_wdxiaoxi@2x.png" alt="" lay-url="{:url('news/index')}" lay-event="jump"/>
        <img src="/static/index/images/user/ic_wdshezhi@2x.png" alt="" lay-url="{:url('user/setting')}"
             lay-event="jump"/>
    </div>

    <div class="info flex items-center mt-30">
        <div class="photo">
            <img src="{$user.photo}" alt=""/>
        </div>
        <div class="right">
            <div class="title">{$user.nickname}</div>
            <div class="flex items-center">
                <div class="level flex items-center">
                    <img src="/static/index/images/user/ic_yhhuiy@2x.png" alt=""/>
                    <div class="level-name">黄金会员</div>
                </div>
            </div>
        </div>
    </div>

    <div class="category-container items-center justify-evenly mt-30">
        {foreach name="assets" item="vo" key="key"}
        <div class="category-item flex flex-col items-center justify-center w-25"
             lay-url="{:url('account/record',['type'=>$key])}"
             lay-event="jump">
            <div class="upper"><?php echo $user->assets[$key];?></div>
            <div class="category-text">{$vo}</div>
        </div>
        {/foreach}
    </div>


    <div class="card mt-30">
        <div class="card-title flex items-center justify-between">
            <div class="left">我的订单</div>
            <div class="right" lay-url="{:url('order/my_order')}" lay-event="jump">全部订单 <i
                    class="layui-icon layui-icon-right"></i>
            </div>
        </div>
        <div class="card-item">
            <div class="category-container justify-between ">
                {foreach name="$orderStatus" item="vo"}
                <div class="category-item flex flex-col items-center justify-center w-25"
                     lay-url="{:url('order/my_order')}?type={$vo.status}"
                     lay-event="jump">
                    <img src="/static/index/images/user/order-icon-{$vo.status}.png" alt="{$vo.title}">
                    <div class="category-text color-66">{$vo.title}</div>
                    {if $vo.count > 0}
                    <div class="tips">{$vo.count > 99 ? 99 : $vo.count}</div>
                    {/if}
                </div>
                {/foreach}
            </div>
        </div>
    </div>


    <div class="card mt-30">
        <div class="card-title flex items-center justify-between">
            <div class="left">常用功能</div>
        </div>
        <div class="card-item">
            <div class="category-container">
                {foreach name="$fun" item="vo"}
                <div class="fun-item category-item flex flex-col items-center justify-center w-25"
                     lay-url="{$vo.url}"
                     lay-event="jump">
                    <img src="/static/index/images/user/{$vo.icon}" alt="">
                    <div class="category-text color-66">{$vo.title}</div>
                </div>
                {/foreach}
            </div>
        </div>
    </div>
    <button class="btn border-btn" lay-click="logout">退出登录</button>
</div>
{include file="public/menu" select="4"/}
</body>
{include file="public/footer" /}
<script>
    layui.use(['methods'], function () {
        var m = layui.methods, ly = layui.layer;
        m.event.click('logout', function (data, that) {
            ly.confirm('确定要退出登录吗？', {title: '请确认'}, function () {
                return m.fetchPostThrottle('{:url("user/logout")}')
            });
        });

    });
</script>
</html>